/**
 * 
 */
package co.fitstart.entity.order;

import com.demo2do.core.utils.Alias;

/**
 * 
 * @author mohanlan
 *
 */
@Alias("orderStatus")
public enum MoyuOrderStatus {
    
    CREATED("created", "待支付", "info", "created"),
    
    PAID("paid", "已支付", "danger", "paid"),
    
    PROCESSING("processing", "已发货", "success", "processing"),
    
    COMPLETE("compelte", "已完成", "default", "closed");
    
    private String alias;

    private String description;

    private String css;
    
    private String same;
    
    /**
     * @param alias
     * @param description
     * @param css
     */
    MoyuOrderStatus(String alias, String description, String css, String same) {
        this.alias = alias;
        this.description = description;
        this.css = css;
        this.same = same;
    }
    
    /**
     * 
     * @param alias
     * @return
     */
    public static OrderStatus aliasOf(String alias) {
        for(OrderStatus orderStatus : OrderStatus.values()) {
            if(orderStatus.getAlias().equalsIgnoreCase(alias)){
                return orderStatus;
            }
        }
        return null;
    }
    
    
    /**
     * @return boolean OrderStatus equals COMPLETE or not
     */
    public boolean isComplete(){
    	return this.equals(COMPLETE);
    }
    
    
    /**
     * @return the alias
     */
    public String getAlias() {
        return alias;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @return the css
     */
    public String getCss() {
        return css;
    }
    
    /**
     * 
     * @return the same
     */
    public String getSame() {
        return same;
    }
    
}
